import request from '@/utils/request'

// 查询安全教育活动台账列表
export function listEducation(query) {
  return request({
    url: '/ledger/education/list',
    method: 'get',
    params: query
  })
}

// 查询安全教育活动台账详细
export function getEducation(id) {
  return request({
    url: '/ledger/education/' + id,
    method: 'get'
  })
}

// 新增安全教育活动台账
export function addEducation(data) {
  return request({
    url: '/ledger/education',
    method: 'post',
    data: data
  })
}

// 修改安全教育活动台账
export function updateEducation(data) {
  return request({
    url: '/ledger/education',
    method: 'put',
    data: data
  })
}

// 删除安全教育活动台账
export function delEducation(id) {
  return request({
    url: '/ledger/education/' + id,
    method: 'delete'
  })
}

export function deleteAttendWorker(id) {
  return request({
    url: '/ledger/education/deleteAttendWorker?id='+id,
    method: 'delete'
  })
}

export function addAttendWorker(data) {
  return request({
    url: '/ledger/education/addAttendWorker',
    method: 'post',
    data: data
  })
}

// 导出安全教育活动台账
export function exportEducation(query) {
  return request({
    url: '/ledger/education/export',
    method: 'get',
    params: query
  })
}

//获取未参加培训人员列表
export function SelectNoAttendWorkerList(params){
  return request({
    url:"/ledger/education/selectNoAttendWorkerList",
    method: 'get',
    params
  })
}

//获取参加培训人员列表
export function selectAttendWorkerList(params){
  return request({
    url:"/ledger/education/selectAttendWorkerList",
    method: 'get',
    params
  })
}

// 导出安全教育活动台账详情
export function exportEducationDetail(id) {
  return request({
    url: '/ledger/education/exportDetail/'+id,
    method: 'get'
  })
}

//获取未出席人员列表
export function selectNoAttendees(params){
  return request({
    url:"/ledger/education/selectNoAttendees",
    method: 'get',
    params
  })
}

//获取出席人员列表
export function selectAttendees(params){
  return request({
    url:"/ledger/education/selectAttendees",
    method: 'get',
    params
  })
}
